import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '父级节点',
    align:"center",
    dataIndex: 'parentId'
   },
   {
    title: '是否有子节点',
    align:"center",
    dataIndex: 'hasChild'
   },
   {
    title: '补偿项名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '编号',
    align:"center",
    dataIndex: 'no'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'ordernum'
   },
   {
    title: '描述',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '类型',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '等级',
    align:"center",
    dataIndex: 'level'
   },
   {
    title: 'att_type',
    align:"center",
    dataIndex: 'attType'
   },
   {
    title: 'unit',
    align:"center",
    dataIndex: 'unit'
   },
   {
    title: 'unit_name',
    align:"center",
    dataIndex: 'unitName'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '父级节点',
    field: 'parentId',
    component: 'Input',
  },
  {
    label: '是否有子节点',
    field: 'hasChild',
    component: 'Input',
  },
  {
    label: '补偿项名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '编号',
    field: 'no',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'ordernum',
    component: 'InputNumber',
  },
  {
    label: '描述',
    field: 'remark',
    component: 'InputTextArea',
  },
  {
    label: '类型',
    field: 'type',
    component: 'Input',
  },
  {
    label: '等级',
    field: 'level',
    component: 'InputNumber',
  },
  {
    label: 'att_type',
    field: 'attType',
    component: 'Input',
  },
  {
    label: 'unit',
    field: 'unit',
    component: 'Input',
  },
  {
    label: 'unit_name',
    field: 'unitName',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  parentId: {title: '父级节点',order: 0,view: 'text', type: 'string',},
  hasChild: {title: '是否有子节点',order: 1,view: 'text', type: 'string',},
  name: {title: '补偿项名',order: 2,view: 'text', type: 'string',},
  no: {title: '编号',order: 3,view: 'text', type: 'string',},
  ordernum: {title: '排序',order: 4,view: 'number', type: 'number',},
  remark: {title: '描述',order: 5,view: 'textarea', type: 'string',},
  type: {title: '类型',order: 6,view: 'text', type: 'string',},
  level: {title: '等级',order: 7,view: 'number', type: 'number',},
  attType: {title: 'att_type',order: 8,view: 'text', type: 'string',},
  unit: {title: 'unit',order: 9,view: 'text', type: 'string',},
  unitName: {title: 'unit_name',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}